package com.hunan.api.catv.action.account;

import com.hunan.api.catv.action.BaseAction;
import com.hunan.api.catv.annotation.MemberAuth;
import com.hunan.api.catv.common.Api;
import com.hunan.api.catv.entity.Result;
import com.hunan.api.catv.entity.po.MemberReconciliationRecord;
import com.hunan.api.catv.service.biz.account.AccountReconciliationBiz;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
 * @Author: wangchao
 * @Date: 2020/10/27 16:58
 */
@RestController
@Validated
@RequestMapping(Api.member_reconciliation)
public class AccountReconciliationAction extends BaseAction {

    @Autowired
    AccountReconciliationBiz accountReconciliationBiz;

    /**
     * 保存用户提现操作记录
     */
    @PostMapping("/saveMemberReconciliationInfo")
    public Result saveMemberReconciliationInfo(@RequestBody MemberReconciliationRecord memberReconciliationRecord) {
        return buildOK(accountReconciliationBiz.saveMemberReconciliationInfo(memberReconciliationRecord), "");
    }

    /**
     * 用户提现记录列表
     */
    @MemberAuth
    @GetMapping("/getMemberReconciliationList/{pageNum}/{pageSize}")
    public Result getMemberReconciliationList(@PathVariable("pageNum") int pageNum, @PathVariable("pageSize") int pageSize, HttpServletRequest request) {
        return buildOK(accountReconciliationBiz.getMemberReconciliationList(pageNum, pageSize, getMemberId(request)), "");
    }


}
